<template>
  <div>
    <h1>this is test page homeapi</h1>
    <button @click="btnGetFn">GET</button>
    <template>
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="id" label="id" width="200"> </el-table-column>
        <el-table-column prop="body" label="body" width="180">
        </el-table-column>
        <el-table-column prop="postId" label="postId"> </el-table-column>
      </el-table>
    </template>
  </div>
</template>

<script>
import { nanoid } from "nanoid";
import { getInfoAPI } from "@/api";
export default {
  data() {
    return {
      tableData: [],
    };
  },
  methods: {
    btnGetFn() {
      // async btnGetFn() {
      //  const res =await getInfoAPI();
      //  console.log(res.data);
      getInfoAPI().then((res) => {
        console.log(res.data);
        this.tableData = res.data;
      });
    },
  },
};
</script>

<style></style>
